<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
			request.setAttribute("path",path);
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
		<title>My JSP 'index.jsp' starting page</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	</head>
	<body>
	
	<c:set var="username" value="Mical" scope="session"></c:set>
	
	${sessionScope.username }
	
	
	<c:set var="username1" scope="session">xujun</c:set>
	
	${sessionScope.username1 }
	
	<c:out value="${header['User-Agent']}"></c:out>
	
	<c:out value="${param['data']}"></c:out>
	
	<h1><c:out value="catch use" /></h1>
	
	<c:catch var="errmsg">
		<%
		String ef = "ss";
		int i = Integer.parseInt(ef);
		 %>
	</c:catch>
	
	${errmsg }
	
	<h1><c:out value="c:if" /></h1>
	<c:if test="${param['data'] == 'admin'}" var="result">
		amdin hello!
	</c:if>
	${result }
	
	
	<h1><c:out value="c:choose c:when c:otherwise" /></h1>
	
	<c:choose>
		<c:when test="${param['data'] == 'admin'}">
			admin hello
		</c:when>
		<c:when test="${param['data'] == 'xujun'}">
			xujun hello
		</c:when>
		<c:otherwise>
			ohterwise
		</c:otherwise>
	</c:choose>
	
	
	<h1>c:foreach</h1>
	
	<%
		ArrayList list = new ArrayList();
		list.add("123");
		list.add("1234");
		list.add("12345");
		list.add("123456");
		request.setAttribute("list",list);
	 %>
	<c:forEach items="${list}" var="item">
		${item }
	</c:forEach>
	
	${path }
	</body>
</html>
